package com.xframe.domain.e3sp.basedata;

import com.xframe.domain.BaseModel;
import com.xframe.domain.sys.SysValueDetail;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description: 车辆编码
 * @ClassName: com.xframe.domain.e3sp.basedata.VehiclCode
 * @Author: xufeng
 * @CreateTime: 2024/1/1
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_vehicl_code", label = "车辆编码")
@XSelectItem(keyName = "vehiclCodeId",codeName = "swCode",textName = "nameCn")
@XSelectItem(keyName = "vehiclCodeId",codeName = "swCode",textName = "nameEn",language = "en")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.AnnVehicleModel",foreignKey = "vehModelId", targetKey = "vehModelId",as = "refVehicleModel")
@XBelongsTo(typeName = "com.xframe.domain.sys.SysValueDetail",foreignKey = "drive", targetKey = "val", refTableAddString = "val_code = 'drive'", as = "refDrive")
@XBelongsTo(typeName = "com.xframe.domain.sys.SysValueDetail",foreignKey = "emission", targetKey = "val",refTableAddString = "val_code = 'emission'",as = "refEmission")
@XBelongsTo(typeName = "com.xframe.domain.sys.SysValueDetail",foreignKey = "engineModel", targetKey = "val",refTableAddString = "val_code = 'enginemodel'",as = "refengineModel")
@XBelongsTo(typeName = "com.xframe.domain.sys.SysValueDetail",foreignKey = "configuration", targetKey = "val",refTableAddString = "val_code = 'configuration'",as = "refConfig")
public class VehiclCode extends BaseModel {

    /**
     * 车辆编码ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "vehicl_code_id", primaryKeyFlag = true,desc = "车辆编码ID")
    private Long vehiclCodeId;

    /**
     * 公告车型ID
     */
    @XQueryCondition
    @XColumn(name = "veh_model_id",desc = "公告车型ID")
    private Long vehModelId;

    /**
     * 车型四位编码
     */
    @XQueryCondition
    @XGridTableRef
    @XColumn(name = "sw_code", uniqueFlag = true,desc = "车型代号",length = 200)
    private String swCode;

    /**
     * 中文名称
     */
    @XColumn(name = "name_cn",desc = "公告车型中文名称",length = 200)
    private String nameCn;

    /**
     * 英文名称
     */
    @XColumn(name = "name_en",desc = "公告车型英文名称",nullFlag = true,length = 200)
    private String nameEn;
    /**
     * 驱动(值列表 = drive)
     */
    @XQueryCondition(valueCode = "drive",sorts = "orderNo:DESC")
    @XColumn(name = "drive",desc = "驱动",length = 100,nullFlag = true)
    private String drive;

    /**
     * 排放(值列表 = emission)
     */
    @XQueryCondition(valueCode = "emission",sorts = "orderNo:DESC")
    @XColumn(name = "emission",desc = "排放",length = 100,nullFlag = true)
    private String emission;

    /**
     * 发动机型号(值列表 = enginemodel)
     */
    @XQueryCondition(valueCode = "enginemodel",sorts = "orderNo:DESC")
    @XColumn(name = "engine_model",desc = "发动机型号",length = 100,nullFlag = true)
    private String engineModel;

    /**
     * 配置(值列表 = configuration)
     */
    @XQueryCondition(valueCode = "configuration",sorts = "orderNo:DESC")
    @XColumn(name = "configuration",desc = "配置",length = 100,nullFlag = true)
    private String configuration;


    /**
     * 说明
     */
    @XColumn(name = "description", nullFlag = true,desc = "说明",length = 500)
    private String description;

    /**
     * 公告车型
     */
    private AnnVehicleModel refVehicleModel;

    /**
     * 驱动值列表
     */
    private SysValueDetail refDrive;
    /**
     * 排放值列表
     */
    private SysValueDetail refEmission;
    /**
     * 发动机型号值列表
     */
    private SysValueDetail refengineModel;
    /**
     * 配置值列表
     */
    private SysValueDetail refConfig;

}
